textview: fix assertion when toggling caret visibility
authorChristian Hergert <chergert@redhat.com>
Tue, 21 Apr 2020 20:39:50 +0000 (13:39 -0700)
committerChristian Hergert <chergert@redhat.com>
Tue, 21 Apr 2020 20:39:50 +0000 (13:39 -0700)
When toggling caret visibility (with F7) we would hit an assertion if the
cursor is currently blinking. This adjusts things to ensure that we should
be showing the carent when scheduling our blink timeouts.

Fixes #2647

gtk/gtktextview.c

index 1835c4fd14e793658dd220af7c08cae911d0c284..8426cbb4acbd0bb001165f4c65581f7b2efc3005 100644 (file)
@@ -6048,7 +6048,7 @@ gtk_text_view_check_cursor_blink (GtkTextView *text_view)
 {
   GtkTextViewPrivate *priv = text_view->priv;
 
-  if (cursor_blinks (text_view))
+  if (cursor_blinks (text_view) && cursor_visible (text_view))
     {
       if (!priv->blink_tick)
         add_blink_timeout (text_view, FALSE);